//
//  LHSegMentControl.h
//  lehuotest
//
//  Created by ice on 2017/1/12.
//  Copyright © 2017年 QF. All rights reserved.
//

#import <UIKit/UIKit.h>
@class LHSegMentControl;

typedef void(^LHSegMentPageChangeBlock)(NSInteger index);

@interface LHSegMentControl : UIView


/**
 button的标题   最后设置标题
 */
@property (nonatomic, strong) NSArray *titles;

/**
 pageindex改变block
 */
@property (nonatomic, copy) LHSegMentPageChangeBlock pageChangeBlock;


/**
 需要外部scrollView 实现此方法 记录滑动前scrollView.contentOffset.x
 -(void)scrollViewWillBeginDragging:(UIScrollView *)scrollView {
    self.historyX = scrollView.contentOffset.x;
    self.segMent.historyX = self.historyX;
 }
 */
@property (nonatomic, assign) CGFloat historyX;

/************设置属性****************/

/**
 字体放大系数   (0.....1)
 */
@property (nonatomic, assign) CGFloat textScale;

/**
 是否显示下划线
 */
@property (nonatomic, assign) BOOL IsShowIndicatorView;
/**
 下划线高度
 */
@property (nonatomic, assign) CGFloat indicatorViewHeight;

/**
 下划线颜色
 */
@property (nonatomic, strong) UIColor *indicatorColor;

/**
 设置默认title颜色和字体
 */
@property (nonatomic, strong) NSDictionary *titleTextAttributes;

/**
 设置选中title颜色和字体
 */
@property (nonatomic, strong) NSDictionary *selectedTitleTextAttributes;

/**
 是否显示sortbtn
 */
@property (nonatomic, assign) BOOL isShowSortBtn;

-(instancetype) initWithFrame:(CGRect)frame;


/**
 标题选中颜色改变以及指示器位置变化

 @param scrollView scrollView
 */
- (void)titleBtnSelectedWithScrollView:(UIScrollView *)scrollView;

/**
  给外界scrollViewDidScroll方法提供文字渐显效果

 @param scrollView scrollView
 */
- (void)titleBtnColorGradualChangeScrollViewDidScroll:(UIScrollView *)scrollView;
@end
